package com.example.demo;

import oracle.jdbc.dcn.DatabaseChangeEvent;
import oracle.jdbc.dcn.DatabaseChangeEvent;
import oracle.jdbc.dcn.DatabaseChangeListener;

class DCNDemoListener implements DatabaseChangeListener  {
    JDBCDemo demo;
    DCNDemoListener(JDBCDemo dem)
    {
        demo = dem;
    }
    public void onDatabaseChangeNotification(DatabaseChangeEvent e)
    {
        Thread t = Thread.currentThread();
        System.out.println("DCNDemoListener: got an event ("+this+" running on thread "+t+")");
        System.out.println(e.toString());
        synchronized( demo ){ demo.notify();}
    }
}
